(function() {
	window.determinemodify = {
		init: function() {

			this.events()
			this.pass = /^\S{6,12}$/
		},
		signin: function() {

		},
		events: function() {
			common.focu("input", "green")
			$(".next-button").on("tap", function() {
				var uid = localStorage.getItem("uid")
				var toast= localStorage.getItem("token")
				if(!(determinemodify.pass.test($(".password").val()) && determinemodify.pass.test($(".determinepassword").val()))) {
					mui.toast("请输入6到12位的密码!")
					return
				}
				if($(".password").val() != $(".determinepassword").val()) {
					mui.toast("输入的密码不一致!")
					return
				}
				
				
				common.ajax("student/resetPasswordWithoutOld", {
					token: '',
					uid: uid,
					password1: $(".password").val(),
					password2: $(".determinepassword").val()
				}, function(data) {
					if(data.code == 200) {
						common.open("login.html", "")
						mui.toast("修改成功")
					} else {
						mui.toast(data.message)
					}
				})
			})
		}
	}
	determinemodify.init()
})()